Skip to content

Set default SVG currentColor to black#3400

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
DLTKJoelJohansson:svg-fg-color
Jul 2, 2026
Merged

Set default SVG currentColor to black#3400
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
DLTKJoelJohansson:svg-fg-color

Conversation

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor

An attempt at fixing #3398.
Let me know what you think.

Thanks!

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

Cant get the build run locally, and jenkins reporting build errors, maybe someone can take a look? Thanks

@merks

merks commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Don't do merge commits; we can't merge this into master in the end because we don't accept merge commits. In fact don't do multiple commits in general. Use rebase. Amend you commit and force push it when you need to make subsequent follow up changes. You'll need to rebase and force push to repair this PR.

@merks

merks commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I'll approve the workflow so you can see any errors in the GitHub actions. Please rebase and force push to get this back on track.

@merks

merks commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

See we even fail with a check for merge commits:

image

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Test Results

  200 files  ±0    200 suites  ±0   26m 58s ⏱️ -34s
4 744 tests +1  4 720 ✅ +1   24 💤 ±0  0 ❌ ±0 
6 892 runs  +6  6 724 ✅ +6  168 💤 ±0  0 ❌ ±0 

Results for commit b7a37fb. ± Comparison against base commit b31dbba.

♻️ This comment has been updated with latest results.

@merks

merks commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I've approved the workflow again. I'll be out of office for a few hours...

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

Cant seem to figure it out, its failing for Linux builds

@DLTKJoelJohansson DLTKJoelJohansson force-pushed the svg-fg-color branch 2 times, most recently from 8aa4474 to 34c413c Compare June 23, 2026 10:33
@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

Okay got it to work now! Moved out the Display.getDefault() call to org.eclipse.swt bundle (In SVGFileFormat, the caller) fixed it.

Thanks @merks for your help. Let me know what you think

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

Maybe not, seems like the Browser tests for Windows are failing. Pretty strange

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

@merks any thoughts on this? I have a hard time seeing how these changes can cause the Browser tests to fail on Windows, since the changes only touch the SVG Rasterization

@merks

merks commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

It could just be a flaky test. I'll rerun it.

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

Looks like the same Browser tests are failing again, but at least the build succeeded now

@merks

merks commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@HeikoKlare

I've not looked closely, but is the failure of the browser test on Windows related to this PR or maybe known to be flaky?

@joeljohansson99

Copy link
Copy Markdown

Thanks @HeikoKlare, and @merks! This PR should ready for review now

@merks

merks commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@HeikoKlare

I will leave it to someone qualified to review the changes.

@HeikoKlare HeikoKlare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for proposing a solution to the mentioned issue. I have some concerns regarding the proposed solution (please see the detailed comment). What could also help is an example (e.g., a snippet or an RCP extension) that demonstrates the behavior and the change, so that we can easily test different alternatives.

@DLTKJoelJohansson DLTKJoelJohansson changed the title Set default SVG color to match the SWT.COLOR_WIDGET_FOREGROUND Set default SVG currentColor to black Jun 30, 2026
@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

Thanks @HeikoKlare for the feedback. I made the change so now we simply set the default foreground color to black, reverting back to the behaviour it was before the change in the underlying renderer.

I also added a regression test as you proposed. I am just checking one pixel seeing if its black. I guess you could test all pixels but I kinda felt it was overkill. Maybe there is an easier way to test this, but I could not find any.

Jenkins are failing too, not sure why. From the info I can see the compiler is saying Unnecessary @SuppressWarnings("restriction") which is very wierd since its not something I added. Any ideas what could cause this?

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

@HeikoKlare, any thoughts on this? It might not be the compiler that is failing the build, but I cannot see any details

@HeikoKlare HeikoKlare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for updating the fix with this simple restoration of the previous behavior. We identified just today that our product is also affected by this issue, so I directly tested the proposed fix with it. I can confirm that is properly restores the previous behavior.

The test also looks sound to me. Just testing a single pixel is absolutely sufficient.

The reported warnings in the failing Jenkins check are strange. They are obviously not introduced by this PR. I have restarted the Jenkins build. Let's see if the next run produces proper results.

@DLTKJoelJohansson

Copy link
Copy Markdown
Contributor Author

Thank you, great! I see that the build is still giving the same results

@HeikoKlare

Copy link
Copy Markdown
Contributor

I have retriggered an SWT master build and we see the same warnings reported there: https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/master/1937/

image

Only difference I see between the previous and the current build is a newer ECJ version, but I did not find any suspicious changes at ECJ.

Anyway, the new warnings are not related to this PR and there is no other degradation reported in the build, so I will merge it as is.

@HeikoKlare HeikoKlare merged commit 3fe6d2b into eclipse-platform:master Jul 2, 2026
21 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants